home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 29 / CDT29.iso / e-Mail / WorldClient Pro 2.2.3 / wcsetup.exe / WEBHELP.ZIP / WebHelp.class (.txt) < prev    next >
Encoding:
Java Class File  |  1999-10-21  |  14.8 KB  |  1,019 lines

  1. import hhapplet.AboutDialogBox;
  2. import hhapplet.ButtonLauncher;
  3. import hhapplet.ButtonPushEvent;
  4. import hhapplet.ButtonPushEventListener;
  5. import hhapplet.DialogDoneTarget;
  6. import hhapplet.FTSPane;
  7. import hhapplet.FTSParser;
  8. import hhapplet.FTSSearcher;
  9. import hhapplet.IndexPane;
  10. import hhapplet.IndexSecondaryDialog;
  11. import hhapplet.IndexSecondaryEntry;
  12. import hhapplet.LabelLauncher;
  13. import hhapplet.PopupMenu;
  14. import hhapplet.SiteMapParserToContents;
  15. import hhapplet.SiteMapParserToIndex;
  16. import hhapplet.SplashScreen;
  17. import hhapplet.TabButton;
  18. import hhapplet.TabPanel;
  19. import hhapplet.URLFileHandler;
  20. import java.applet.Applet;
  21. import java.awt.BorderLayout;
  22. import java.awt.CardLayout;
  23. import java.awt.Color;
  24. import java.awt.Component;
  25. import java.awt.Container;
  26. import java.awt.Image;
  27. import java.awt.Label;
  28. import java.awt.LayoutManager;
  29. import java.awt.Panel;
  30. import java.awt.Rectangle;
  31. import java.awt.Window;
  32. import java.net.MalformedURLException;
  33. import java.net.URL;
  34. import java.util.Vector;
  35. import sitemap.SiteMapParser;
  36. import treeview.TreeViewImageSet;
  37.  
  38. public class WebHelp extends Applet implements ButtonPushEventListener {
  39.    private static final String STR_APPLET_ID = "WebHelp Applet Version 1.03.131";
  40.    private static final String STR_COPYRIGHT = "Copyright (c) 1998-1999 Blue Sky Software Corp. All rights reserved.";
  41.    private Window m_winFrameToShow = null;
  42.    private String m_strContentsFile = null;
  43.    private String m_strIndexFile = null;
  44.    private String m_strSearchFile = null;
  45.    private String m_strHelpFile = null;
  46.    private boolean m_bContentsLoaded = false;
  47.    private boolean m_bIndexLoaded = false;
  48.    private boolean m_bSearchLoaded = false;
  49.    private boolean m_bHelpLoaded = false;
  50.    private String m_strCurrentCommand = null;
  51.    private Panel m_pnlNav = null;
  52.    private TabPanel m_pnlTabs = null;
  53.    private CardLayout m_clLayout = null;
  54.    private boolean m_bParsing = false;
  55.    private Image[] m_imgList = null;
  56.    private TreeViewImageSet m_tvisImages = null;
  57.    private SiteMapParser m_smpContents = null;
  58.    private SiteMapParser m_smpIndex = null;
  59.    private SiteMapParser m_smpHelp = null;
  60.    private IndexPane m_ipIndex = null;
  61.    private FTSPane m_spSearch = null;
  62.    private Thread contents_thread = null;
  63.    private Thread parser_thread = null;
  64.    private Thread search_thread = null;
  65.    private TabButton m_tbtnToc = null;
  66.    private TabButton m_tbtnIndex = null;
  67.    private TabButton m_tbtnSearch = null;
  68.    private TabButton m_tbtnHelp = null;
  69.    private boolean m_bMustHaveSize = false;
  70.    private boolean m_bIsIE3 = false;
  71.    private long m_lnTimeCreated = System.currentTimeMillis();
  72.    private FTSParser m_ftsParser = null;
  73.    private FTSSearcher m_ftsSearcher = null;
  74.  
  75.    public void stop() {
  76.       if (this.m_winFrameToShow != null) {
  77.          this.m_winFrameToShow.hide();
  78.       }
  79.  
  80.       System.gc();
  81.       Runtime.getRuntime().gc();
  82.    }
  83.  
  84.    public void notifyButtonPushEvent(ButtonPushEvent var1) {
  85.       if (var1.getSource() == this.m_tbtnToc) {
  86.          boolean var9 = false;
  87.          if (this.m_tbtnToc != null) {
  88.             this.m_tbtnToc.disable();
  89.             this.m_tbtnToc.repaint(0L);
  90.          }
  91.  
  92.          if (this.m_tbtnIndex != null) {
  93.             this.m_tbtnIndex.enable();
  94.             this.m_tbtnIndex.SetDrawRight(true);
  95.             if (!var9) {
  96.                var9 = true;
  97.                this.m_tbtnIndex.SetDrawLeft(false);
  98.             } else {
  99.                this.m_tbtnIndex.SetDrawLeft(true);
  100.             }
  101.  
  102.             this.m_tbtnIndex.repaint(0L);
  103.          }
  104.  
  105.          if (this.m_tbtnSearch != null) {
  106.             this.m_tbtnSearch.enable();
  107.             this.m_tbtnSearch.SetDrawRight(true);
  108.             if (!var9) {
  109.                var9 = true;
  110.                this.m_tbtnSearch.SetDrawLeft(false);
  111.             } else {
  112.                this.m_tbtnSearch.SetDrawLeft(true);
  113.             }
  114.  
  115.             this.m_tbtnSearch.repaint(0L);
  116.          }
  117.  
  118.          if (this.m_tbtnHelp != null) {
  119.             this.m_tbtnHelp.enable();
  120.             this.m_tbtnHelp.SetDrawRight(true);
  121.             if (!var9) {
  122.                var9 = true;
  123.                this.m_tbtnHelp.SetDrawLeft(false);
  124.             } else {
  125.                this.m_tbtnHelp.SetDrawLeft(true);
  126.             }
  127.  
  128.             this.m_tbtnHelp.repaint(0L);
  129.          }
  130.  
  131.          this.RepaintTabs();
  132.          this.DoContents(this.m_strContentsFile);
  133.       } else if (var1.getSource() == this.m_tbtnIndex) {
  134.          boolean var7 = false;
  135.          boolean var12 = false;
  136.          if (this.m_tbtnToc != null) {
  137.             this.m_tbtnToc.enable();
  138.             this.m_tbtnToc.SetDrawLeft(true);
  139.             if (!var12) {
  140.                var12 = true;
  141.                this.m_tbtnToc.SetDrawRight(false);
  142.             } else {
  143.                this.m_tbtnToc.SetDrawRight(true);
  144.             }
  145.  
  146.             this.m_tbtnToc.repaint(0L);
  147.          }
  148.  
  149.          if (this.m_tbtnIndex != null) {
  150.             this.m_tbtnIndex.disable();
  151.             this.m_tbtnIndex.repaint(0L);
  152.          }
  153.  
  154.          if (this.m_tbtnSearch != null) {
  155.             this.m_tbtnSearch.enable();
  156.             this.m_tbtnSearch.SetDrawRight(true);
  157.             if (!var7) {
  158.                var7 = true;
  159.                this.m_tbtnSearch.SetDrawLeft(false);
  160.             } else {
  161.                this.m_tbtnSearch.SetDrawLeft(true);
  162.             }
  163.  
  164.             this.m_tbtnSearch.repaint(0L);
  165.          }
  166.  
  167.          if (this.m_tbtnHelp != null) {
  168.             this.m_tbtnHelp.enable();
  169.             this.m_tbtnHelp.SetDrawRight(true);
  170.             if (!var7) {
  171.                var7 = true;
  172.                this.m_tbtnHelp.SetDrawLeft(false);
  173.             } else {
  174.                this.m_tbtnHelp.SetDrawLeft(true);
  175.             }
  176.  
  177.             this.m_tbtnHelp.repaint(0L);
  178.          }
  179.  
  180.          this.RepaintTabs();
  181.          this.DoIndex(this.m_strIndexFile);
  182.       } else if (var1.getSource() == this.m_tbtnSearch) {
  183.          boolean var5 = false;
  184.          boolean var3 = false;
  185.          if (this.m_tbtnIndex != null) {
  186.             this.m_tbtnIndex.enable();
  187.             this.m_tbtnIndex.SetDrawLeft(true);
  188.             if (!var3) {
  189.                var3 = true;
  190.                this.m_tbtnIndex.SetDrawRight(false);
  191.             } else {
  192.                this.m_tbtnIndex.SetDrawRight(true);
  193.             }
  194.  
  195.             this.m_tbtnIndex.repaint(0L);
  196.          }
  197.  
  198.          if (this.m_tbtnToc != null) {
  199.             this.m_tbtnToc.enable();
  200.             this.m_tbtnToc.SetDrawLeft(true);
  201.             if (!var3) {
  202.                var3 = true;
  203.                this.m_tbtnToc.SetDrawRight(false);
  204.             } else {
  205.                this.m_tbtnToc.SetDrawRight(true);
  206.             }
  207.  
  208.             this.m_tbtnToc.repaint(0L);
  209.          }
  210.  
  211.          if (this.m_tbtnSearch != null) {
  212.             this.m_tbtnSearch.disable();
  213.             this.m_tbtnSearch.repaint(0L);
  214.          }
  215.  
  216.          if (this.m_tbtnHelp != null) {
  217.             this.m_tbtnHelp.enable();
  218.             this.m_tbtnHelp.SetDrawRight(true);
  219.             if (!var5) {
  220.                var5 = true;
  221.                this.m_tbtnHelp.SetDrawLeft(false);
  222.             } else {
  223.                this.m_tbtnHelp.SetDrawLeft(true);
  224.             }
  225.  
  226.             this.m_tbtnHelp.repaint(0L);
  227.          }
  228.  
  229.          this.RepaintTabs();
  230.          this.DoSearch(this.m_strSearchFile);
  231.       } else {
  232.          if (this.m_tbtnHelp != null && var1.getSource() == this.m_tbtnHelp) {
  233.             boolean var2 = false;
  234.             if (this.m_tbtnSearch != null) {
  235.                this.m_tbtnSearch.enable();
  236.                this.m_tbtnSearch.SetDrawLeft(true);
  237.                if (!var2) {
  238.                   var2 = true;
  239.                   this.m_tbtnSearch.SetDrawRight(false);
  240.                } else {
  241.                   this.m_tbtnSearch.SetDrawRight(true);
  242.                }
  243.  
  244.                this.m_tbtnSearch.repaint(0L);
  245.             }
  246.  
  247.             if (this.m_tbtnIndex != null) {
  248.                this.m_tbtnIndex.enable();
  249.                this.m_tbtnIndex.SetDrawLeft(true);
  250.                if (!var2) {
  251.                   var2 = true;
  252.                   this.m_tbtnIndex.SetDrawRight(false);
  253.                } else {
  254.                   this.m_tbtnIndex.SetDrawRight(true);
  255.                }
  256.  
  257.                this.m_tbtnIndex.repaint(0L);
  258.             }
  259.  
  260.             if (this.m_tbtnToc != null) {
  261.                this.m_tbtnToc.enable();
  262.                this.m_tbtnToc.SetDrawLeft(true);
  263.                if (!var2) {
  264.                   var2 = true;
  265.                   this.m_tbtnToc.SetDrawRight(false);
  266.                } else {
  267.                   this.m_tbtnToc.SetDrawRight(true);
  268.                }
  269.  
  270.                this.m_tbtnToc.repaint(0L);
  271.             }
  272.  
  273.             if (this.m_tbtnHelp != null) {
  274.                this.m_tbtnHelp.disable();
  275.                this.m_tbtnHelp.repaint(0L);
  276.             }
  277.  
  278.             this.RepaintTabs();
  279.             this.DoHelp(this.m_strHelpFile);
  280.          }
  281.  
  282.       }
  283.    }
  284.  
  285.    private void DoBadCommand(String var1) {
  286.       ((Container)this).add(new Label("The command \"" + var1 + "\" is unrecognised"));
  287.    }
  288.  
  289.    private void DoNavPane() {
  290.       ((Component)this).setBackground(new Color(192, 192, 192));
  291.       ((Container)this).setLayout(new BorderLayout());
  292.       this.m_strContentsFile = ((Applet)this).getParameter("ContentsFile");
  293.       this.m_strIndexFile = ((Applet)this).getParameter("IndexFile");
  294.       this.m_strSearchFile = ((Applet)this).getParameter("SearchFile");
  295.       this.m_strHelpFile = ((Applet)this).getParameter("HelpFile");
  296.       String var1 = null;
  297.       if (this.m_strContentsFile != null) {
  298.          var1 = ((Applet)this).getParameter("TocTab");
  299.          if (var1 == null) {
  300.             var1 = " Contents ";
  301.          }
  302.       }
  303.  
  304.       String var2 = null;
  305.       if (this.m_strIndexFile != null) {
  306.          var2 = ((Applet)this).getParameter("IndexTab");
  307.          if (var2 == null) {
  308.             var2 = " Index ";
  309.          }
  310.       }
  311.  
  312.       String var3 = null;
  313.       if (this.m_strSearchFile != null) {
  314.          var3 = ((Applet)this).getParameter("SearchTab");
  315.          if (var3 == null) {
  316.             var3 = " Search ";
  317.          }
  318.       }
  319.  
  320.       String var4 = null;
  321.       if (this.m_strHelpFile != null) {
  322.          var4 = ((Applet)this).getParameter("HelpTab");
  323.          if (var4 == null) {
  324.             var4 = "Help";
  325.          }
  326.       }
  327.  
  328.       this.m_pnlTabs = null;
  329.       this.m_pnlTabs = new TabPanel();
  330.       this.m_pnlTabs.setLayout((LayoutManager)null);
  331.       if (this.m_strContentsFile != null) {
  332.          this.m_tbtnToc = new TabButton(var1);
  333.          this.m_tbtnToc.addButtonPushEventListener(this);
  334.          this.m_pnlTabs.add(this.m_tbtnToc);
  335.       }
  336.  
  337.       if (this.m_strIndexFile != null) {
  338.          this.m_tbtnIndex = new TabButton(var2);
  339.          this.m_tbtnIndex.addButtonPushEventListener(this);
  340.          this.m_pnlTabs.add(this.m_tbtnIndex);
  341.       }
  342.  
  343.       if (this.m_strSearchFile != null) {
  344.          this.m_tbtnSearch = new TabButton(var3);
  345.          this.m_tbtnSearch.addButtonPushEventListener(this);
  346.          this.m_pnlTabs.add(this.m_tbtnSearch);
  347.       }
  348.  
  349.       if (this.m_strHelpFile != null) {
  350.          this.m_tbtnHelp = new TabButton(var4);
  351.          this.m_tbtnHelp.addButtonPushEventListener(this);
  352.          this.m_pnlTabs.add(this.m_tbtnHelp);
  353.       }
  354.  
  355.       ((Container)this).add("North", this.m_pnlTabs);
  356.       Rectangle var5 = ((Component)this).bounds();
  357.       if (this.m_tbtnToc != null) {
  358.          this.rods_reshape(this.m_tbtnToc, 1, var5.y, this.m_tbtnToc.preferredSize().width, 25);
  359.       }
  360.  
  361.       if (this.m_tbtnIndex != null) {
  362.          int var6 = 1;
  363.          if (this.m_tbtnToc != null) {
  364.             var6 += this.m_tbtnToc.bounds().width;
  365.          }
  366.  
  367.          this.rods_reshape(this.m_tbtnIndex, var6, var5.y, this.m_tbtnIndex.preferredSize().width, 25);
  368.       }
  369.  
  370.       if (this.m_tbtnSearch != null) {
  371.          int var13 = 1;
  372.          if (this.m_tbtnToc != null) {
  373.             var13 += this.m_tbtnToc.bounds().width;
  374.          }
  375.  
  376.          if (this.m_tbtnIndex != null) {
  377.             var13 += this.m_tbtnIndex.bounds().width;
  378.          }
  379.  
  380.          this.rods_reshape(this.m_tbtnSearch, var13, var5.y, this.m_tbtnSearch.preferredSize().width, 25);
  381.       }
  382.  
  383.       if (this.m_tbtnHelp != null) {
  384.          int var14 = 1;
  385.          if (this.m_tbtnToc != null) {
  386.             var14 += this.m_tbtnToc.bounds().width;
  387.          }
  388.  
  389.          if (this.m_tbtnIndex != null) {
  390.             var14 += this.m_tbtnIndex.bounds().width;
  391.          }
  392.  
  393.          if (this.m_tbtnSearch != null) {
  394.             var14 += this.m_tbtnSearch.bounds().width;
  395.          }
  396.  
  397.          this.rods_reshape(this.m_tbtnHelp, var14, var5.y, this.m_tbtnHelp.preferredSize().width, 25);
  398.       }
  399.  
  400.       this.rods_reshape(this.m_pnlTabs, var5.x, var5.y, var5.width, 28);
  401.       this.m_pnlTabs.requestFocus();
  402.       if (this.m_tbtnIndex != null) {
  403.          this.m_tbtnIndex.enable();
  404.       }
  405.  
  406.       if (this.m_tbtnToc != null) {
  407.          this.m_tbtnToc.enable();
  408.       }
  409.  
  410.       if (this.m_tbtnSearch != null) {
  411.          this.m_tbtnSearch.enable();
  412.       }
  413.  
  414.       if (this.m_tbtnHelp != null) {
  415.          this.m_tbtnHelp.enable();
  416.       }
  417.  
  418.       if (this.m_tbtnToc != null) {
  419.          this.m_tbtnToc.disable();
  420.       }
  421.  
  422.       if (this.m_tbtnIndex != null) {
  423.          this.m_tbtnIndex.disable();
  424.       }
  425.  
  426.       if (this.m_tbtnSearch != null) {
  427.          this.m_tbtnSearch.disable();
  428.       }
  429.  
  430.       if (this.m_tbtnHelp != null) {
  431.          this.m_tbtnHelp.disable();
  432.       }
  433.  
  434.       boolean var15 = true;
  435.       boolean var7 = true;
  436.       String var8 = ((Applet)this).getParameter("CurrentTab");
  437.       if (var8 != null && (var8.equalsIgnoreCase("Index") || var8.equalsIgnoreCase("Search"))) {
  438.          var15 = false;
  439.       }
  440.  
  441.       if (var8 != null && (var8.equalsIgnoreCase("Contents") || var8.equalsIgnoreCase("Search"))) {
  442.          var7 = false;
  443.       }
  444.  
  445.       Object var9 = null;
  446.       ButtonPushEvent var16;
  447.       if (var15) {
  448.          var16 = new ButtonPushEvent(this.m_tbtnToc, 0, 0);
  449.       } else if (var7) {
  450.          var16 = new ButtonPushEvent(this.m_tbtnIndex, 0, 0);
  451.       } else {
  452.          var16 = new ButtonPushEvent(this.m_tbtnSearch, 0, 0);
  453.       }
  454.  
  455.       this.notifyButtonPushEvent(var16);
  456.  
  457.       try {
  458.          String var10 = System.getProperty("java.vendor");
  459.          if (var10.startsWith("Netscape")) {
  460.             Panel var11 = new Panel();
  461.             ((Container)var11).setLayout((LayoutManager)null);
  462.             ((Component)var11).resize(((Component)this).bounds().width, 14);
  463.             ((Container)this).add("South", var11);
  464.             return;
  465.          }
  466.       } catch (Exception var12) {
  467.       }
  468.  
  469.    }
  470.  
  471.    public void Command(String var1, String var2) {
  472.       if (var1 != null) {
  473.          if (var1.equalsIgnoreCase("Contents")) {
  474.             this.DoContents(var2);
  475.          } else if (var1.equalsIgnoreCase("Index")) {
  476.             this.DoIndex(var2);
  477.          } else if (var1.equalsIgnoreCase("Search")) {
  478.             this.DoSearch(var2);
  479.          } else if (var1.equalsIgnoreCase("Version")) {
  480.             this.ShowVersion();
  481.          } else {
  482.             this.DoBadCommand("Command method does not support " + var1);
  483.          }
  484.       }
  485.    }
  486.  
  487.    public void destroy() {
  488.       if (this.m_winFrameToShow != null) {
  489.          this.m_winFrameToShow.hide();
  490.          this.m_winFrameToShow.dispose();
  491.          this.m_winFrameToShow = null;
  492.       }
  493.  
  494.       if (this.m_smpContents != null) {
  495.          this.m_smpContents.closeFiles();
  496.          this.m_smpContents = null;
  497.       }
  498.  
  499.       if (this.m_smpIndex != null) {
  500.          this.m_smpIndex.closeFiles();
  501.          this.m_smpIndex = null;
  502.       }
  503.  
  504.       if (this.m_smpHelp != null) {
  505.          this.m_smpHelp.closeFiles();
  506.          this.m_smpHelp = null;
  507.       }
  508.  
  509.       if (this.m_ipIndex != null && this.m_ipIndex.getList() != null) {
  510.          this.m_ipIndex.getList().clear();
  511.       }
  512.  
  513.       if (this.m_ipIndex != null && this.m_ipIndex.getForAppleList() != null) {
  514.          this.m_ipIndex.getForAppleList().clear();
  515.       }
  516.  
  517.       if (this.m_ipIndex != null) {
  518.          this.m_ipIndex = null;
  519.       }
  520.  
  521.       if (this.m_spSearch != null && this.m_spSearch.getList() != null) {
  522.          this.m_spSearch.getList().clear();
  523.          this.m_spSearch = null;
  524.       }
  525.  
  526.       if (this.m_tvisImages != null) {
  527.          this.m_tvisImages.releaseImages(this.m_imgList);
  528.          this.m_tvisImages = null;
  529.       }
  530.  
  531.       if (this.contents_thread != null && this.contents_thread.isAlive()) {
  532.          this.contents_thread.stop();
  533.          this.contents_thread = null;
  534.       }
  535.  
  536.       if (this.parser_thread != null && this.parser_thread.isAlive()) {
  537.          this.parser_thread.stop();
  538.          this.parser_thread = null;
  539.       }
  540.  
  541.       if (this.search_thread != null && this.search_thread.isAlive()) {
  542.          this.search_thread.stop();
  543.          this.search_thread = null;
  544.       }
  545.  
  546.       System.gc();
  547.       Runtime.getRuntime().gc();
  548.    }
  549.  
  550.    protected void rods_reshape(Component var1, int var2, int var3, int var4, int var5) {
  551.       var1.move(var2, var3);
  552.       var1.resize(var4, var5);
  553.    }
  554.  
  555.    private void DoContents(String var1) {
  556.       if (var1 == null) {
  557.          ((Container)this).setLayout(new BorderLayout());
  558.       }
  559.  
  560.       if (this.m_pnlNav == null) {
  561.          this.m_clLayout = new CardLayout();
  562.          this.m_pnlNav = new Panel();
  563.          this.m_pnlNav.setLayout(this.m_clLayout);
  564.          ((Container)this).add("Center", this.m_pnlNav);
  565.       }
  566.  
  567.       if (this.m_tvisImages == null) {
  568.          this.m_tvisImages = new TreeViewImageSet();
  569.          this.m_imgList = new Image[14];
  570.          this.m_imgList = this.m_tvisImages.reallyGetImages();
  571.       }
  572.  
  573.       if (var1 == null) {
  574.          var1 = ((Applet)this).getParameter("Item1");
  575.       }
  576.  
  577.       if (this.m_bContentsLoaded && this.m_strContentsFile != null && this.m_strContentsFile.equals(var1)) {
  578.          this.m_clLayout.show(this.m_pnlNav, "Contents");
  579.          if (this.m_smpContents != null) {
  580.             ((SiteMapParserToContents)this.m_smpContents.getOutput()).getTree().requestFocus();
  581.          }
  582.  
  583.       } else {
  584.          this.m_strContentsFile = var1;
  585.          this.m_bContentsLoaded = true;
  586.          this.m_bMustHaveSize = true;
  587.          ((Component)this).repaint(0L);
  588.          this.RepaintTabs();
  589.          SiteMapParserToContents var2 = new SiteMapParserToContents(this, this.m_imgList);
  590.          if (this.m_smpContents != null) {
  591.             this.m_smpContents.closeFiles();
  592.          }
  593.  
  594.          ((Applet)this).showStatus("Loading Table of Contents...");
  595.          this.m_pnlNav.add("Contents", var2.getTree());
  596.          this.m_clLayout.show(this.m_pnlNav, "Contents");
  597.          var2.getTree().requestFocus();
  598.          ((Component)this).repaint(0L);
  599.          ((Component)this).show();
  600.          this.m_smpContents = new SiteMapParser(var2);
  601.          this.contents_thread = this.m_smpContents.parseInSeparateThread(var1, ((Applet)this).getDocumentBase(), this);
  602.          var2.getTree().requestFocus();
  603.       }
  604.    }
  605.  
  606.    private void DoHHVersion(boolean var1) {
  607.       String var2 = null;
  608.       Object var3 = null;
  609.       String var4 = null;
  610.       if (!var1) {
  611.          var2 = ((Applet)this).getParameter("Button");
  612.          String var12 = ((Applet)this).getParameter("Text");
  613.          if (var2 == null && var12 == null) {
  614.             return;
  615.          }
  616.  
  617.          var4 = var2 != null ? var2 : var12;
  618.       }
  619.  
  620.       Vector var5 = new Vector();
  621.       var5.addElement("WebHelp Applet Version 1.03.131");
  622.       var5.addElement("Copyright (c) 1998-1999 Blue Sky Software Corp. All rights reserved.");
  623.  
  624.       try {
  625.          var5.addElement("Java VM vendor: " + System.getProperty("java.vendor"));
  626.       } catch (Exception var11) {
  627.       }
  628.  
  629.       try {
  630.          var5.addElement("Java version: " + System.getProperty("java.version"));
  631.       } catch (Exception var10) {
  632.       }
  633.  
  634.       try {
  635.          var5.addElement("Java library version: " + System.getProperty("java.class.version"));
  636.       } catch (Exception var9) {
  637.       }
  638.  
  639.       try {
  640.          String var6 = "Operating System: " + System.getProperty("os.name") + " " + System.getProperty("os.version") + " (" + System.getProperty("os.arch") + ")";
  641.          var5.addElement(var6);
  642.       } catch (Exception var8) {
  643.       }
  644.  
  645.       AboutDialogBox var13 = new AboutDialogBox("About WebHelp Applet", var5);
  646.       if (var1) {
  647.          var13.show();
  648.       } else {
  649.          Object var7 = var2 != null ? new ButtonLauncher(var4, var13) : new LabelLauncher(var4, var13);
  650.          ((Container)this).setLayout(new BorderLayout());
  651.          ((Container)this).add("Center", (Component)var7);
  652.          this.m_winFrameToShow = var13;
  653.       }
  654.    }
  655.  
  656.    public synchronized void resize(int var1, int var2) {
  657.       if (System.getProperty("java.vendor").startsWith("Netscape") && (System.getProperty("os.name").startsWith("Windows") || System.getProperty("os.name").startsWith("Mac")) && !((Applet)this).getParameter("BrowserVersion").equalsIgnoreCase("4.6")) {
  658.          WebHelp$JavaScriptAccess var3 = new WebHelp$JavaScriptAccess(this, this);
  659.          int var4 = var3.GetHeight();
  660.          if (var4 >= 0) {
  661.             var2 = var4;
  662.          }
  663.       }
  664.  
  665.       super.resize(var1, var2);
  666.    }
  667.  
  668.    public synchronized boolean checkSize() {
  669.       if (((Component)this).bounds().width == 0 && ((Component)this).bounds().height == 0) {
  670.          String var1 = ((Applet)this).getDocumentBase().toString();
  671.          int var2 = var1.lastIndexOf(".");
  672.          String var3 = var1.substring(var2, var1.length());
  673.          var1 = var1.substring(0, var2);
  674.          var1 = var1 + "f" + var3;
  675.  
  676.          try {
  677.             URL var4 = new URL(var1);
  678.             ((Applet)this).getAppletContext().showDocument(var4, "_self");
  679.             return false;
  680.          } catch (Exception var5) {
  681.          }
  682.       }
  683.  
  684.       return true;
  685.    }
  686.  
  687.    private void DoSearch(String var1) {
  688.       if (var1 == null) {
  689.          ((Container)this).setLayout(new BorderLayout());
  690.       }
  691.  
  692.       if (this.m_pnlNav == null) {
  693.          this.m_clLayout = new CardLayout();
  694.          this.m_pnlNav = new Panel();
  695.          this.m_pnlNav.setLayout(this.m_clLayout);
  696.          ((Container)this).add("Center", this.m_pnlNav);
  697.       }
  698.  
  699.       if (var1 == null) {
  700.          var1 = ((Applet)this).getParameter("Item1");
  701.       }
  702.  
  703.       if (this.m_bSearchLoaded && this.m_strSearchFile != null && this.m_strSearchFile.equals(var1)) {
  704.          this.m_clLayout.show(this.m_pnlNav, "Search");
  705.          if (this.m_spSearch != null) {
  706.             this.m_spSearch.getEditBox().requestFocus();
  707.          }
  708.  
  709.       } else {
  710.          this.m_strSearchFile = var1;
  711.          this.m_bSearchLoaded = true;
  712.          this.m_bMustHaveSize = true;
  713.          this.m_ftsParser = new FTSParser(this);
  714.          this.m_spSearch = this.m_ftsParser.getFTS();
  715.          this.m_ftsSearcher = this.m_ftsParser.getSearcher();
  716.          if (this.m_spSearch != null && this.m_spSearch.getList() != null) {
  717.             this.m_spSearch.getList().clear();
  718.             this.m_spSearch.getList().addItem("Reading Search Data...");
  719.          }
  720.  
  721.          this.m_pnlNav.add("Search", this.m_spSearch);
  722.          this.m_clLayout.show(this.m_pnlNav, "Search");
  723.          ((Component)this).repaint();
  724.          this.RepaintTabs();
  725.          ((Applet)this).showStatus("Reading Search Data...");
  726.          ((Component)this).show();
  727.          this.search_thread = this.m_ftsParser.parseInSeparateThread(var1, ((Applet)this).getDocumentBase());
  728.       }
  729.    }
  730.  
  731.    private void DoSplash() {
  732.       ((Applet)this).showStatus("Loading Splash Image...");
  733.  
  734.       try {
  735.          Object var1 = null;
  736.          Object var2 = null;
  737.  
  738.          try {
  739.             var13 = ((Applet)this).getImage(URLFileHandler.makeURL(((Applet)this).getDocumentBase(), ((Applet)this).getParameter("Item1"), (String)null));
  740.          } finally {
  741.             ;
  742.          }
  743.  
  744.          int var3 = 2500;
  745.  
  746.          try {
  747.             var3 = new Integer(((Applet)this).getParameter("Item2"));
  748.          } catch (NumberFormatException var10) {
  749.          }
  750.  
  751.          SplashScreen var4 = new SplashScreen(this, var13, var3, (String)var2);
  752.          var4.show();
  753.       } catch (MalformedURLException var12) {
  754.          ((Container)this).add("Center", new Label("Can't open URL or file " + ((Throwable)var12).getMessage()));
  755.       }
  756.    }
  757.  
  758.    private void DoAboutBox() {
  759.       String var1 = ((Applet)this).getParameter("Button");
  760.       String var2 = ((Applet)this).getParameter("Text");
  761.       if (var1 != null || var2 != null) {
  762.          String var3 = var1 != null ? var1 : var2;
  763.          String var4 = ((Applet)this).getParameter("Item1");
  764.          Vector var5 = new Vector();
  765.  
  766.          String var7;
  767.          for(int var6 = 0; (var7 = ((Applet)this).getParameter("Item" + (var6 + 2))) != null; ++var6) {
  768.             var5.addElement(var7);
  769.          }
  770.  
  771.          AboutDialogBox var8 = new AboutDialogBox(var4, var5);
  772.          Object var9 = var1 != null ? new ButtonLauncher(var3, var8) : new LabelLauncher(var3, var8);
  773.          ((Container)this).setLayout(new BorderLayout());
  774.          ((Container)this).add("Center", (Component)var9);
  775.          this.m_winFrameToShow = var8;
  776.       }
  777.    }
  778.  
  779.    private void RepaintTabs() {
  780.       if (this.m_pnlNav != null) {
  781.          this.m_pnlNav.paintAll(this.m_pnlNav.getGraphics());
  782.       }
  783.  
  784.       if (this.m_tbtnToc != null) {
  785.          this.m_tbtnToc.paint(this.m_tbtnToc.getGraphics());
  786.       }
  787.  
  788.       if (this.m_tbtnIndex != null) {
  789.          this.m_tbtnIndex.paint(this.m_tbtnIndex.getGraphics());
  790.       }
  791.  
  792.       if (this.m_tbtnSearch != null) {
  793.          this.m_tbtnSearch.paint(this.m_tbtnSearch.getGraphics());
  794.       }
  795.  
  796.       if (this.m_tbtnHelp != null) {
  797.          this.m_tbtnHelp.paint(this.m_tbtnHelp.getGraphics());
  798.       }
  799.  
  800.    }
  801.  
  802.    private void DoIndex(String var1) {
  803.       if (var1 == null) {
  804.          ((Container)this).setLayout(new BorderLayout());
  805.       }
  806.  
  807.       if (this.m_pnlNav == null) {
  808.          this.m_clLayout = new CardLayout();
  809.          this.m_pnlNav = new Panel();
  810.          this.m_pnlNav.setLayout(this.m_clLayout);
  811.          ((Container)this).add("Center", this.m_pnlNav);
  812.       }
  813.  
  814.       if (var1 == null) {
  815.          var1 = ((Applet)this).getParameter("Item1");
  816.       }
  817.  
  818.       if (this.m_bIndexLoaded && this.m_strIndexFile != null && this.m_strIndexFile.equals(var1)) {
  819.          this.m_clLayout.show(this.m_pnlNav, "Index");
  820.          if (this.m_ipIndex != null) {
  821.             this.m_ipIndex.getEditBox().requestFocus();
  822.          }
  823.  
  824.       } else {
  825.          this.m_strIndexFile = var1;
  826.          this.m_bIndexLoaded = true;
  827.          this.m_bMustHaveSize = true;
  828.          SiteMapParserToIndex var2 = new SiteMapParserToIndex(this);
  829.          if (this.m_ipIndex != null && this.m_ipIndex.getList() != null) {
  830.             this.m_ipIndex.getList().clear();
  831.          }
  832.  
  833.          this.m_ipIndex = var2.getIndex();
  834.          this.m_pnlNav.add("Index", this.m_ipIndex);
  835.          this.m_clLayout.show(this.m_pnlNav, "Index");
  836.          this.m_pnlNav.paintAll(this.m_pnlNav.getGraphics());
  837.          this.RepaintTabs();
  838.          ((Applet)this).showStatus("Loading Index...");
  839.          if (this.m_smpIndex != null) {
  840.             this.m_smpIndex.closeFiles();
  841.          }
  842.  
  843.          if (this.m_ipIndex != null) {
  844.             this.m_ipIndex.getEditBox().requestFocus();
  845.          }
  846.  
  847.          ((Component)this).show();
  848.          this.m_smpIndex = new SiteMapParser(var2);
  849.          if (this.m_ipIndex.GetUseForAppleListFlag()) {
  850.             this.m_ipIndex.paintAll(this.m_ipIndex.getGraphics());
  851.             this.m_smpIndex.parseInCurrentThread(var1, ((Applet)this).getDocumentBase(), this);
  852.          } else {
  853.             this.parser_thread = this.m_smpIndex.parseInSeparateThread(var1, ((Applet)this).getDocumentBase(), this);
  854.          }
  855.       }
  856.    }
  857.  
  858.    public void start() {
  859.       if (this.m_bMustHaveSize) {
  860.          this.checkSize();
  861.       }
  862.  
  863.    }
  864.  
  865.    public String getAppletInfo() {
  866.       return "WebHelp Applet Version 1.03.131" + "\r\n" + "Copyright (c) 1998-1999 Blue Sky Software Corp. All rights reserved.";
  867.    }
  868.  
  869.    public void Click() {
  870.       if (this.m_winFrameToShow != null) {
  871.          if (this.m_bIsIE3) {
  872.             MethodRunner var1 = new MethodRunner(this.m_winFrameToShow, "ClickThread");
  873.             ((Thread)var1).start();
  874.             return;
  875.          }
  876.  
  877.          this.m_winFrameToShow.show();
  878.       }
  879.  
  880.    }
  881.  
  882.    private void ShowVersion() {
  883.       this.DoHHVersion(true);
  884.    }
  885.  
  886.    public static int GetFontSize() {
  887.       byte var0 = 12;
  888.       return var0;
  889.    }
  890.  
  891.    public static String GetFontName() {
  892.       return "Dialog";
  893.    }
  894.  
  895.    public void init() {
  896.       System.gc();
  897.       Runtime.getRuntime().gc();
  898.       this.m_lnTimeCreated = System.currentTimeMillis();
  899.       System.out.println("********************Java Information*********************");
  900.       System.out.println("Java VM");
  901.       System.out.println("  Version = " + System.getProperty("java.version"));
  902.       System.out.println("  Vender = " + System.getProperty("java.vendor"));
  903.       System.out.println("Operating System");
  904.       System.out.println("  Name = " + System.getProperty("os.name"));
  905.       System.out.println("Memory");
  906.       System.out.println("  Total = " + Runtime.getRuntime().totalMemory());
  907.       System.out.println("  Free = " + Runtime.getRuntime().freeMemory());
  908.       System.out.println("*********************************************************");
  909.       if (System.getProperty("java.vendor").startsWith("Microsoft") && System.getProperty("java.version").startsWith("1.0")) {
  910.          this.m_bIsIE3 = true;
  911.       }
  912.  
  913.       String var1 = ((Applet)this).getParameter("Command");
  914.       if (var1 != null) {
  915.          if (var1.equalsIgnoreCase("Contents")) {
  916.             this.DoContents((String)null);
  917.          } else if (var1.equalsIgnoreCase("Index")) {
  918.             this.DoIndex((String)null);
  919.          } else if (var1.equalsIgnoreCase("Search")) {
  920.             this.DoSearch((String)null);
  921.          } else if (var1.equalsIgnoreCase("Splash")) {
  922.             this.DoSplash();
  923.          } else if (var1.equalsIgnoreCase("Help")) {
  924.             this.DoHelp((String)null);
  925.          } else if (var1.equalsIgnoreCase("Related Topics")) {
  926.             this.DoRelatedTopics(false);
  927.          } else if (var1.equalsIgnoreCase("Related Topics,MENU")) {
  928.             this.DoRelatedTopics(true);
  929.          } else if (var1.equalsIgnoreCase("HH Version")) {
  930.             this.DoHHVersion(false);
  931.          } else if (var1.equalsIgnoreCase("AboutBox")) {
  932.             this.DoAboutBox();
  933.          } else if (var1.equalsIgnoreCase("NavPane")) {
  934.             this.DoNavPane();
  935.          } else {
  936.             this.DoBadCommand(var1);
  937.          }
  938.  
  939.          this.m_strCurrentCommand = var1;
  940.          ((Component)this).show();
  941.       }
  942.    }
  943.  
  944.    private void DoHelp(String var1) {
  945.    }
  946.  
  947.    private void DoRelatedTopics(boolean var1) {
  948.       ((Applet)this).showStatus("Loading Related Topics Button...");
  949.       String var2 = ((Applet)this).getParameter("Button");
  950.       String var3 = ((Applet)this).getParameter("Text");
  951.       String var4 = ((Applet)this).getParameter("Frame");
  952.       if (var1 && System.getProperty("os.name").startsWith("SunOS")) {
  953.          var1 = false;
  954.       }
  955.  
  956.       boolean var5 = var2 == null && var3 == null;
  957.       String var6 = "";
  958.       if (!var5) {
  959.          var6 = var2 != null ? var2 : var3;
  960.       }
  961.  
  962.       Vector var7 = new Vector();
  963.       int var8 = 0;
  964.  
  965.       String var9;
  966.       while((var9 = ((Applet)this).getParameter("Item" + (var8 + 1))) != null) {
  967.          IndexSecondaryEntry var10 = new IndexSecondaryEntry();
  968.          int var11 = var9.indexOf(59);
  969.          if (var11 != -1 && var11 != var9.length() - 1) {
  970.             int var12 = var9.indexOf(59, var11 + 1);
  971.             String var13 = var9.substring(0, var11);
  972.             String var14 = var12 == -1 ? var9.substring(var11 + 1) : var9.substring(var11 + 1, var12);
  973.             String var15 = var12 == -1 ? null : var9.substring(var11 + 1);
  974.             var10.name = var13;
  975.             var10.local = var14;
  976.             var10.url = var15;
  977.             var10.frame = var4;
  978.             var7.addElement(var10);
  979.             ++var8;
  980.          }
  981.       }
  982.  
  983.       if (var8 != 0) {
  984.          if (var1) {
  985.             PopupMenu var17 = new PopupMenu(this, var7);
  986.             this.m_winFrameToShow = var17;
  987.          } else {
  988.             IndexSecondaryDialog var18 = new IndexSecondaryDialog(this, var7, (DialogDoneTarget)null);
  989.             this.m_winFrameToShow = var18;
  990.          }
  991.  
  992.          if (!var5) {
  993.             Object var16;
  994.             if (var2 != null) {
  995.                var16 = new ButtonLauncher(var6, this.m_winFrameToShow);
  996.             } else {
  997.                var16 = new LabelLauncher(var6, this.m_winFrameToShow);
  998.             }
  999.  
  1000.             ((Container)this).setLayout(new BorderLayout());
  1001.             ((Container)this).add("Center", (Component)var16);
  1002.          }
  1003.  
  1004.       }
  1005.    }
  1006.  
  1007.    public synchronized void reshape(int var1, int var2, int var3, int var4) {
  1008.       if (System.getProperty("java.vendor").startsWith("Netscape") && (System.getProperty("os.name").startsWith("Windows") || System.getProperty("os.name").startsWith("Mac")) && !((Applet)this).getParameter("BrowserVersion").equalsIgnoreCase("4.6")) {
  1009.          WebHelp$JavaScriptAccess var5 = new WebHelp$JavaScriptAccess(this, this);
  1010.          int var6 = var5.GetHeight();
  1011.          if (var6 >= 0) {
  1012.             var4 = var6;
  1013.          }
  1014.       }
  1015.  
  1016.       super.reshape(var1, var2, var3, var4);
  1017.    }
  1018. }
  1019.